package com.flyxteam.commons.httpclient;

import java.util.Map;

import javax.servlet.http.Cookie;

import org.apache.http.impl.client.CloseableHttpClient;

/**
 * <b>功能：</b>HttpClient操作，提供在后台发送HTTP协议的请求<br>
 * <b>Copyright TCSL</b>
 * <ul>
 * <li>版本&nbsp;&nbsp;&nbsp;&nbsp;修改日期&nbsp;&nbsp;&nbsp;&nbsp;部　　门&nbsp;&nbsp;&nbsp;&nbsp;作　者&nbsp;&nbsp;&nbsp;&nbsp;变更内容</li>
 * <hr>
 * <li>v1.0&nbsp;&nbsp;&nbsp;&nbsp;20150105&nbsp;&nbsp;技术中心&nbsp;&nbsp;&nbsp;&nbsp;史　盟&nbsp;&nbsp;&nbsp;&nbsp;创建类</li>
 * </ul>
 */
public interface HttpClientSession {

	/**
	 * <b>功能描述：</b>执行一个GET请求<br>
	 * <b>修订记录：</b><br>
	 * <li>20141202&nbsp;&nbsp;|&nbsp;&nbsp;史　盟&nbsp;&nbsp;|&nbsp;&nbsp;创建方法</li><br>
	 * 
	 * @see #execute()
	 */
	public HttpClientResult doGet(String url, Map<String, Object> body, Map<String, Object> header, HttpClientConfig config, Cookie[] cookies) throws HttpClientTimeoutException;
	
	/**
	 * <b>功能描述：</b>执行一个Http请求<br>
	 * <b>修订记录：</b><br>
	 * <li>20141101&nbsp;&nbsp;|&nbsp;&nbsp;史盟&nbsp;&nbsp;|&nbsp;&nbsp;创建方法</li><br>
	 * 
	 * @param url 请求地址
	 * @param method 请求方式(post, get)
	 * @param enctype 表单类型(default=普通文本, multipart=包含二进制)
	 * @param body 请求体数据
	 * @param header 请求头参数
	 * @param config 相关配置
	 * @return {@link HttpClientResult} HttpClient返回值
	 * @throws HttpClientTimeoutException HttpClient超时
	 */
	public HttpClientResult execute(String url, String method, String enctype, Map<String, Object> body, Map<String, Object> header, HttpClientConfig config, Cookie[] cookies) throws HttpClientTimeoutException;

	/**
	 * <b>功能描述：</b>取得HttpClientSession的配置实例<br>
	 * <b>修订记录：</b><br>
	 * <li>20141101&nbsp;&nbsp;|&nbsp;&nbsp;史盟&nbsp;&nbsp;|&nbsp;&nbsp;创建方法</li><br>
	 */
	public HttpClientConfig getConfig();
}
